package service;

import model.OrderModificationRequest;



import model.OrderModification;
import org.junit.platform.commons.logging.LoggerFactory;

import java.util.logging.Logger;

// 修正接口名称拼写错误
public class SimpleAuditService implements AuditService {
    private static final Logger logger = (Logger) LoggerFactory.getLogger(SimpleAuditService.class);

    @Override
    // 修改参数类型为OrderModification
    public void logModification(String orderId, OrderModification modification) {
        // 构造日志信息
        String logEntry = String.format(
                "[订单修改审计] 订单ID: %s | 操作人: %s | 时间: %s | IP: %s | 价格变化: %.2f",
                modification.getOperator(),
                modification.getModifiedAt(),
                modification.getIpAddress(),
                modification.getPriceDifference()
        );


        logger.info(logEntry);


    }

    @Override
    public void logModification(String orderId, OrderModificationRequest request) {

    }
}
